#include <iostream>
#include <vector>
#include <cmath>

int main()
{
	unsigned m, n;

	std::cin >> n >> m;

	std::vector<std::vector<double> > dp(m + 1, std::vector<double>(n + 1, 0));

	double n_ = 1.0 / n;
	for (unsigned i = 1; i <= m; ++i)
	{
		for (unsigned j = 1; j <= n; ++j)
		{
			if (i < j)
				dp[i][j] = 0;
			else if (j == 1)
				dp[i][j] = std::pow(n_, i - 1);
			else
				dp[i][j] = dp[i - 1][j] * ((double)j * n_) + dp[i - 1][j - 1] * (n - j + 1) * n_;
		}
	}

	std::cout.setf(std::ios_base::fixed);
	std::cout.precision(4);

	std::cout << dp[m][n];

	return 0;
}